#pragma once

#include <assert.h>
#include <gdstk/gdstk.hpp>
#include <iostream>
#include "qlib/all.h"

#include <cmath>
#include <map>

namespace qlib {

// 检查对象是否相等
class Check {
 public:
  static bool check_library(Library::s_ptr libir_qlib, gdstk::Library* libir_gdstk);
  static bool check_cell(Cell::s_ptr cell_qlib, gdstk::Cell* cell_gdstk);
  static bool check_polygon(Polygon::s_ptr poly_qlib, gdstk::Polygon* poly_gdstk);
  static bool check_reference(Reference::s_ptr refer_qlib, gdstk::Reference* refer_gdstk);
  static bool check_line(Path::s_ptr line_qlib, gdstk::FlexPath* line_gdstk);

 public:
  static bool check_vec2d(const Vec2d& vec2_a, const gdstk::Vec2& vec2_b);
  static bool check_vec2d_array(const Vec2dArray& points_1, const gdstk::Array<gdstk::Vec2>& points_2);
  static bool check_double_array(const std::vector<double>& points_1, const gdstk::Array<double>& points_2);

  static bool check_repetition(const Repetition& repet_1, const gdstk::Repetition& repet_2);
  static bool check_propert_value(const PropertyValue& value_1, const gdstk::PropertyValue& value_2);
  static bool check_property(const PropertyArray& property_1, const gdstk::Property& property_2);

  static bool compare_string(std::string str_1, char* str_2, int len = -1);
  static bool find_propert_value(const PropertyValue& value_1, const gdstk::PropertyValue& value_2);

  static bool check_element(const LineElement& element_qlib, const gdstk::FlexPathElement& element_gds);

  static bool check(bool value);
};
}  // namespace qlib